<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="HotelEditDlg" widgetVar="HotelEditDialog" modal="true" resizable="false" appendToBody="true" header="#{myBundle.EditHotelTitle}" closeOnEscape="true">

            <h:form id="HotelEditForm">

                <h:panelGroup id="display">
                    <p:panelGrid  columns="2" rendered="#{hotelController.selected != null}">

                        <h:outputLabel value="#{myBundle.EditHotelLabel_idHOTEL}" for="idHOTEL" />
                        <h:outputText id="idHOTEL" value="#{hotelController.selected.idHOTEL}" />

                        <p:outputLabel value="#{myBundle.EditHotelLabel_stelle}" for="stelle" />
                        <p:inputText id="stelle" value="#{hotelController.selected.stelle}" title="#{myBundle.EditHotelTitle_stelle}"/>

                        <p:outputLabel value="#{myBundle.EditHotelLabel_recapito}" for="recapito" />
                        <p:inputText id="recapito" value="#{hotelController.selected.recapito}" title="#{myBundle.EditHotelTitle_recapito}" size="255" maxlength="255"/>

                        <p:outputLabel value="#{myBundle.EditHotelLabel_indirizzo}" for="indirizzo" />
                        <p:selectOneMenu id="indirizzo" value="#{hotelController.selected.indirizzo}"  converter="cittaConverter">
                            <f:selectItem itemLabel="#{myBundle.SelectOneMessage}"/>
                            <f:selectItems value="#{cittaController.items}"
                                           var="indirizzoItem"
                                           itemValue="#{indirizzoItem}"
                                           itemLabel="#{indirizzoItem.nome.toString()}"
                                           />

                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{hotelController.save}" value="#{myBundle.Save}" update="display,:HotelListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,HotelEditDialog);"/>
                    <p:commandButton value="#{myBundle.Cancel}" onclick="HotelEditDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
